{include file="common/header" /}

<section class="content-header">
    <h1>{$venue}开放时间表</h1>
    <ol class="breadcrumb">
        <li><a href="../"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active">场馆预约</li>
        <li class="active">场馆预约开放时间表</li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">
                        <a href="/admin/venreserve/index">
                            <span class="label label-back" onclick='goback()'>
                                <i class="fa fa-chevron-left"></i>
                                返回
                            </span>
                        </a>

                    </h3>
                    <h3 class="box-title">
                        <a href="/admin/venreserve/dateinfo?pid={$_GET['pid']}">
                            <span class="label label-success">
                                <i class="fa fa-plus"></i>
                                新增
                            </span>
                        </a>
                    </h3>
                </div>
                <div class="box-body table-responsive no-padding">
                    <table class="table table-hover" cellspacing="0" border="0" id="ctl00_cphMain_GridView1" style="border-width:0px;border-collapse:collapse;">
                        <tr>
                            <th scope="col">序号</th>
							<th scope="col">活动名称</th>
							<th scope="col">日期/星期</th>
                            <th scope="col">时间段</th>
							<th scope="col">活动人数上限</th>
							<th scope="col">排序</th>
                            <th scope="col">操作</th>
                        </tr>
                        {volist name="list" id="vo"}
                        <tr id="tr_{$vo.id}">
                            <td class="id">{$i}</span></td>
							<td>{$vo.title}</td>
							<td>{if $vo.timetype eq 1}{$vo.date}{else}{$vo.week}{/if}</td>
                            <td>{$vo.dateinfo}</td>
							<td>{$vo.peoplelimit}</td>
							<td>{$vo.sort}</td>
                            <td>
								<a href="/admin/venreserve/dateinfo?id={$vo.id}"><span class="label label-primary"><i class="fa fa-edit"></i> 修改</span></a>
                                <a onclick="funChange({$vo.id});" href="javascript:;" >
                                    <span class="label label-danger">
                                        <i class="fa fa-remove"></i>
                                        删除
                                    </span>
                                </a>
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div id="pager">
                    <!--分页-->
                    {//$list -> render()}
                </div>
            </div>
        </div>
    </div>

</section>
<script src="/layui/layer.js"></script>
<script type="text/javascript">
function funChange(id){
	layer.confirm('确认要删除吗', {icon: 3}, function(){
		$.ajax({
			type: "GET",
			dataType: "json",
			url: '/admin/venreserve/date_del',
			data: {"delid":id},
			async: false,
			success: function(data) {
				if(data == 1){
					layer.msg('删除成功');
					$('#tr_'+id).remove();
				}else if(data == 2){
					layer.msg('没有权限删除');
				}else{
					layer.msg('操作失败'+data);
				}
			},
			error: function(){
				layer.msg('系统错误！请稍后访问');
			}
		});
	});
}
</script>
{include file="common/footer" /}